package org.feiye.studyday18;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestTeacher {
	// 引入slf4j
	public static final Logger log = LoggerFactory.getLogger("org.feiye.studyday18.TestTeacher");

	public static void main(String[] args) {
		if (log.isDebugEnabled())// 允许
			log.debug("开始测试教师类：");
		Teacher t = new Teacher();
		try {
			t.setAge(9999);
			int age = t.getAge();
			System.out.println(age);
		} catch (Exception e) {
			/*
			 * System.err.println("年龄抛出异常"); e.printStackTrace();
			 */
			log.warn("年龄错误！", e);
		}

	}

}
